<?php 
		session_start(); 
		include "function/libfunc.php";
 			if (!empty($_SESSION['username']) && !empty($_SESSION['password'])) { 
		  	$link="Tambah Produk";
		  	include 'themes/head2.php';
			include 'themes/heading.php';
?>

            <div class="row-fluid">

                        <div class="span12">

                            <div class="box">

                                <div class="title">

                                    <h4>
                                        <span class="icon16 icomoon-icon-equalizer-2"></span>
                                        <span><?php echo $link; ?> | <a href="produk.php">Lihat produk</a></span>
                                    </h4>
                                    
                                </div>
                                
                                <div class="content">
                                    <form name="tambahproduk" id="tambahproduk" class="form-horizontal" action="prosestambahproduk.php" method="post" enctype="multipart/form-data">
                                    
										 

                                        <div class="form-row row-fluid">
                                            <div class="span11">
                                                <div class="row-fluid">
                                                    <label class="form-label span4" for="focusedInput">Nama Produk</label>
                                                    <input name="namaproduk" class="span7 focused" id="namaproduk" type="text" />
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="form-row row-fluid">
                                            <div class="span11">
                                                <div class="row-fluid">
                                                    <label class="form-label span4" for="checkboxes">Nama Kategori</label>
                                                    <div class="span7 controls">   
                                                        <select name="idkategori" id="idkategori">
                                        <?php
                                        $link = koneksi_db();
                                        $sql = "select * from kategori ORDER BY namakategori ASC";
                                        $hasil = mysql_query($sql,$link) or exit("Error query: <b>".$sql."</b>.");
										while($data = mysql_fetch_assoc($hasil)){
										?>
                                                            <option value="<?php echo $data['idkategori']; ?>"><?php echo $data['namakategori']; ?></option>
                                                            <?php
															}
															?>
                                                        </select>
                                                    </div> 
                                                </div>
                                            </div> 
                                        </div>
   

                                        <div class="form-row row-fluid">
                                            <div class="span12">
                                                <div class="row-fluid">   
                                                   
                                 <textarea class="tinymce span4" id="deskripsiproduk" name="deskripsi" style="width:100%"></textarea>
                                                </div>
                                            </div>  
                                        </div>
                                        
                                        
                   <div class="row-fluid">

                        <div class="span6">

                            <div class="box">
                                <div class="content">
                                   
                                        <div class="form-row row-fluid">
                                            <div class="span11">
                                                <div class="row-fluid">
                                                    <label class="form-label span4" for="textarea">Gambar</label>
                                                    <input type="file" name="gambar" id="gambar" />
                                                </div>
                                            </div>  
                                        </div>

                                        <div class="form-row row-fluid">
                                            <div class="span11">
                                                <div class="row-fluid">
                                                    <label class="form-label span4" for="prependedInput">Harga</label>
                                                    <div class="input-prepend">
                                                        <span class="add-on">Rp.</span><input class="span12" id="harga" size="16" type="text" name="harga" />
                                                    </div>
												<span class="help-block blue span6">Isi dengan angka!</span>
                                                </div>
                                            </div>
                                        </div>
                                        
                                    	<div class="form-row row-fluid">
                                            <div class="span11">
                                                <div class="row-fluid">
                                                    <label class="form-label span4" for="appendedInput">Stok</label>
                                                    <div class="input-append">
                                                        <input class="span8" id="stok" name="stok" size="16" type="text" /><span class="add-on">Produk</span>
                                                    </div>
 													<span class="help-block blue span6"></span>
                                                    <span class="help-block blue span6"></span>
                                                    <span class="help-block blue span6"></span>

                                                </div>
                                            </div>
                                        </div>
                                </div>

                            </div><!-- End .box -->

                        </div><!-- End .span6 -->
                        

                        <div class="span6">

                            <div class="box">
                                <div class="content">
                                        <div class="form-row row-fluid">
                                            <div class="span11">
                                                <div class="row-fluid">
                                                    <label class="form-label span4" for="appendedInput">Diskon</label>
                                                    <div class="input-append">
                                                        <input class="span8" id="diskon" name="diskon" size="16" type="text" /><span class="add-on">%</span>
                                                    </div>
                                                    <span class="help-block blue span6">Isi dengan angka!</span>
                                                </div>
                                            </div>
                                        </div>
                                        
                                        <div class="form-row row-fluid">
                                            <div class="span11">
                                                <div class="row-fluid">
                                                    <label class="form-label span4" for="checkboxes">Status</label>
                                                    <div class="span8 controls">   
                                                        <select name="status" id="status">
           														<option value="Jual">Jual</option>
                                                                <option value="Baru">Baru</option>
                                                                <option value="Promo">Promo</option>
                                                                <option value="Limit">Limit</option>
                                                          
                                                        </select>
                                                    </div> 
                                                </div>
                                            </div> 
                                        </div>
   

                                        <div class="form-row row-fluid">
                                            <div class="span11">
                                                <div class="row-fluid">
                                                    <label class="form-label span4" for="appendedInput">Kode</label>
                                                    <div class="input-append">
                                                        <input class="span12" id="kode" name="kode" size="16" type="text" required />
                                                    </div>
                                                    <span class="help-block blue span6">Isi dengan angka!</span>
                                                    <span class="help-block blue span6"></span>
                                                </div>
                                            </div>
                                        </div>
                                </div>

                            </div><!-- End .box --

                        </div><!-- End .span6 -->
     
                    
                                    </div>
                                    
                                     <div class="form-actions">
                                           <button type="submit" class="btn btn-info">Simpan</button>
                                           <button type="button" class="btn" onclick="window.history.back()">Cancel</button>
                                        </div>                
                                    </form>
                                 
                                </div>

                            </div><!-- End .box -->

                        </div><!-- End .span6 -->
            <div class="row-fluid">

                        <div class="span12">

                            <div class="box">

                                <div class="title">

                                    <h4>
                                        <span class="icon16 icomoon-icon-equalizer-2"></span>
                                        <span>Tambah Media| <a href="datafile.php">Lihat Media</a></span>
                                    </h4>
                                    
                                </div>
                                
                                <div class="content">
                
                    <form id="fileupload" action="//jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data">
                        <!-- Redirect browsers with JavaScript disabled to the origin page -->
                        <noscript><input type="hidden" name="redirect" value="http://blueimp.github.com/jQuery-File-Upload/"></noscript>
                        <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
                        <div style="margin-left:4px" class="row fileupload-buttonbar">
                            <div  class="span9">
                                <!-- The fileinput-button span is used to style the file input field as button -->
                                <span class="btn btn-success fileinput-button">
                                    <i class="icon-plus icon-white"></i>
                
                                    <input type="file" name="files[]" multiple>
                                </span>
                                <button type="submit" class="btn btn-primary start">
                                    <i class="icon-upload icon-white"></i>
                                    <span>Start upload</span>
                                </button>
                                <button type="reset" class="btn btn-warning cancel">
                                    <i class="icon-ban-circle icon-white"></i>
                                    <span>Cancel upload</span>
                                </button>
                                <button type="button" class="btn btn-danger delete">
                                    <i class="icon-trash icon-white"></i>
                                    <span>Delete</span>
                                </button>
                                <input type="checkbox" class="toggle">
                                <!-- The loading indicator is shown during file processing -->
                                <span class="fileupload-loading"></span>
                            </div>
                            <!-- The global progress information -->
                            <div class="span3 fileupload-progress fade">
                                <!-- The global progress bar -->
                                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
                                    <div class="bar" style="width:0%;"></div>
                                </div>
                                <!-- The extended global progress information -->
                                <div class="progress-extended">&nbsp;</div>
                            </div>
                        </div>
                        <!-- The table listing the files available for upload/download -->
                        <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
                    </form>
                    <br>
                <div id="modal-gallery" class="modal modal-gallery hide fade" data-filter=":odd" tabindex="-1">
                    <div class="modal-header">
                        <a class="close" data-dismiss="modal">&times;</a>
                        <h3 class="modal-title"></h3>
                    </div>
                    <div class="modal-body"><div class="modal-image"></div></div>
                    <div class="modal-footer">
                        <a class="btn modal-download" target="_blank">
                            <i class="icon-download"></i>
                            <span>Download</span>
                        </a>
                        <a class="btn btn-success modal-play modal-slideshow" data-slideshow="5000">
                            <i class="icon-play icon-white"></i>
                            <span>Slideshow</span>
                        </a>
                        <a class="btn btn-info modal-prev">
                            <i class="icon-arrow-left icon-white"></i>
                            <span>Previous</span>
                        </a>
                        <a class="btn btn-primary modal-next">
                            <span>Next</span>
                            <i class="icon-arrow-right icon-white"></i>
                        </a>
                    </div>
                </div>
                
                      </div>               
                                 
                                </div>

                            </div><!-- End .box -->

                        </div><!-- End .span6 -->
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade">
        <td>
            <span class="preview"></span>
        </td>
        <td>
            <p class="name">{%=file.name%}</p>


            {% if (file.error) { %}
                <div><span class="label label-important">Error</span> {%=file.error%}</div>
            {% } %}
        </td>
        <td>
            <p class="size">{%=o.formatFileSize(file.size)%}</p>
            {% if (!o.files.error) { %}
                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>
            {% } %}
        </td>
        <td>
            {% if (!o.files.error && !i && !o.options.autoUpload) { %}
                <button class="btn btn-primary start">
                    <i class="icon-upload icon-white"></i>
                    <span>Start</span>
                </button>
            {% } %}
            {% if (!i) { %}
                <button class="btn btn-warning cancel">
                    <i class="icon-ban-circle icon-white"></i>
                    <span>Cancel</span>
                </button>
            {% } %}
        </td>
    </tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        <td>
            <span class="preview">
                {% if (file.thumbnail_url) { %}
                    <a href="{%=file.url%}" title="{%=file.name%}" data-gallery="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
                {% } %}
            </span>
        </td>
        <td>
            <p class="name">
                <a href="{%=file.url%}" title="{%=file.name%}" data-gallery="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
            </p>
            {% if (file.error) { %}
                <div><span class="label label-important">Error</span> {%=file.error%}</div>
            {% } %}
        </td>
        <td>
            <span class="size">{%=o.formatFileSize(file.size)%}</span>
        </td>
        <td>
            <button class="btn btn-danger delete" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}"{% if (file.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
                <i class="icon-trash icon-white"></i>
                <span>Delete</span>
            </button>
            <input type="checkbox" name="delete" value="1" class="toggle">
        </td>
    </tr>
{% } %}
</script>

<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="plugins/upload/js/vendor/jquery.ui.widget.js"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="plugins/upload/js/tmpl.min.js"></script>
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="plugins/upload/js/load-image.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="plugins/upload/js/canvas-to-blob.min.js"></script>
<!-- Bootstrap JS and Bootstrap Image Gallery are not required, but included for the demo -->
<script src="plugins/upload/js/bootstrap.min.js"></script>
<script src="plugins/upload/js/bootstrap-image-gallery.min.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="plugins/upload/js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="plugins/upload/js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="plugins/upload/js/jquery.fileupload-process.js"></script>
<!-- The File Upload image resize plugin -->
<script src="plugins/upload/js/jquery.fileupload-resize.js"></script>
<!-- The File Upload validation plugin -->
<script src="plugins/upload/js/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="plugins/upload/js/jquery.fileupload-ui.js"></script>
<!-- The main application script -->
<script src="plugins/upload/js/main.js"></script>
	
<?php
include 'themes/footer.php';
}else {
echo "<script language='javascript'>window.location = '../admin/'</script>";
}
?>